package com.guguskins.back.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.guguskins.back.entity.GuUser;
import com.guguskins.back.entity.bo.ChangePasswordBo;
import com.guguskins.back.entity.bo.RegisterUserBo;
import com.guguskins.back.entity.bo.SendCodeBo;
import com.guguskins.back.entity.bo.UserBo;
import com.guguskins.back.entity.vo.PageVo;
import com.guguskins.back.entity.vo.UserInfoVo;
import com.guguskins.back.entity.vo.UserVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-05-08
 */
public interface GuUserService extends IService<GuUser> {

    PageVo<GuUser> backPage(int p, int size, String searchKey);

    void sendCode(SendCodeBo sendCodeBo);
    void sendCodeAuthentication(Long userId);
    void sendCodeAccount(SendCodeBo sendCodeBo);


    String login(UserBo userBo);

    boolean register(RegisterUserBo registerUserBo);

    GuUser userInfoBySteamId(String steamId);

    GuUser getOneBySteamId(String steamId);

    PageVo<GuUser> getPageByRollId(int p, int size, long rollId);

    UserInfoVo getUserInfo(Long userId);

    GuUser getUserInfoSimple(Long userId);

    GuUser uploadUserInfo(GuUser user);

    boolean changePassword(Long userId, ChangePasswordBo changePasswordBo);
    boolean changePasswordByAccount(ChangePasswordBo changePasswordBo);

    boolean addGuCurrency(Long userId, BigDecimal amount, BigDecimal originalAmount, Integer sourceType, Long sourceId, String sourceImage, String sourceName, String desc, String remark);
    boolean subtractGuCurrency(Long userId, BigDecimal amount, BigDecimal originalAmount, Integer sourceType, Long sourceId, String sourceImage, String sourceName, String desc, String remark);

    List<UserVo> backUsersByRollId(long rollId, String searchKey);
    void updateuserRevolutions(Integer userId);

    String getBindingSteamUrl(Long userId);

    boolean bindingSteam(long userId, String steamId);

    GuUser checkInviteCode(Long userId, String inviteCode);

}
